import axios from '@/utils/request'

export const login = (data) => {
  return axios.post('/api/auth/login', data)
}

export const getUserInfo = () => {
  return axios.get('/api/auth/info')
}

// 创建管理员接口
export const createOperator = (data) => {
  return axios.post('/api/operators', data)
}

// 获取管理员列表接口
export const getOperators = (params) => {
  return axios.get('/api/operators', { params })
}

// 获取用户详情接口
export const getOperatorById = (id) => {
  return axios.get(`/api/operators/${id}`)
}

// 更新用户信息接口
export const updateOperator = (id, data) => {
  return axios.put(`/api/operators/${id}`, data)
}

// 删除用户接口
export const deleteOperator = (id) => {
  return axios.delete(`/api/operators/${id}`)
}